package com.ysd.lis.controller;

import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkQualityNode;
import com.ysd.lis.request.WkQualityNodeRequest;
import com.ysd.lis.service.WkQualityNodeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 质量控制-质量控制节点维护
 *
 * @author LuoXS
 * @date 2024/5/15
 * version 1.0
 */
@RestController
@RequestMapping("/wk/quality/node")
public class WkQualityNodeController extends BaseController {

    @Resource
    WkQualityNodeService service;


    @ApiOperation("质量控制-质量控制节点维护列表（分页）")
    @GetMapping("/page")
    public Result pageList(WkQualityNodeRequest.PageParam pageParam) {
        return service.pageList(pageParam);
    }

    @ApiOperation("质量控制-质量控制节点维护列表")
    @GetMapping("/list")
    public Result list(WkQualityNode param) {
        return service.selectList(param);
    }

    @ApiOperation("新增")
    @PostMapping("/add")
    @LogDetail(requestParam = "add", operationType = OperationType.INSERT, module = "质量控制-质量控制节点维护", content = "新增", businessName = "qualityNode")
    public Result add(@RequestBody WkQualityNode params) {
        return service.add(params);
    }


    @ApiOperation("修改")
    @PostMapping("/update")
    @LogDetail(requestParam = "update", operationType = OperationType.UPDATE, module = "质量控制-质量控制节点维护", content = "编辑", businessName = "qualityNode")
    public Result update(@RequestBody WkQualityNode params) {
        return service.updateDit(params);
    }

    @ApiOperation("删除")
    @PostMapping("/delete")
    @LogDetail(requestParam = "delete", operationType = OperationType.DELETE, module = "质量控制-质量控制节点维护", content = "删除", businessName = "qualityNode")
    public Result delete(@RequestBody WkQualityNode deleteParams) {
        return service.delete(deleteParams);
    }

}
